<?php


namespace App\Transformers\Wechat;


use League\Fractal\TransformerAbstract;

class WechatUserTransFormer extends TransformerAbstract
{
    public function transform($data)
    {
    return [
        'id'=>$data->id ,
        'user_id' =>$data->user_id ?? '',
        'group_id' =>$data->group_id ?? '',
        'nickname' =>$data->nickname ?? '',
        'avatar' =>$data->avatar ?? '',
        'phone' =>$data->phone ?? '',
        'qq_number' =>$data->qq_number ?? '',
        'sex' =>$data->sex ?? '',
        'user_type' =>$data->user_type ?? '',
        'language' =>$data->language ?? '',
        'country' =>$data->country ?? '',
        'province' =>$data->province ?? '',
        'city' =>$data->city ?? '',
        'second' =>$data->second ?? '',
        'unionid' =>$data->unionid ?? '',
        'openid' =>$data->openid ?? '',
        'remark' =>$data->remark ?? '',
        'tagid_list' =>$data->tagid_list ?? '',
        'subscribe' =>$data->subscribe ?? '',
        'subscribe_time' =>$data->subscribe_time ?? '',
        'deleted_at' => $data->deleted_at ? $data->deleted_at->format("Y-m-d H:i:s") : '',
        'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
        'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
    ];

    }

}

